package com.itany.corejava.day02;

import java.util.Arrays;

public class Test1 {

    static int k=30;

    public static void main(String[] args) {

        //变量声明
        int i;

        //错，变量必须先初始化，后使用
//        System.out.println("i = " + i);

        //变量初始化
        i=10;


        System.out.println("i = " + i);

        {
            //变量的声明并初始化
            int j=20;
            System.out.println("i = " + i);

            System.out.println("j = " + j);
        }

//        System.out.println("j = " + j);

        System.out.println("k = " + k);

//        错，变量不能重复定义
//        int i=40;
        
        i=40;
        System.out.println("i = " + i);

    }

}
